package kr.re.etri.snsenabler.server;

import java.io.IOException;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import kr.re.etri.snsenabler.server.db.SnsEnablerDbService;

public class SnsEnablerServletListener implements ServletContextListener {

	@Override
	public void contextInitialized(ServletContextEvent contextEvent) {
		try {
			SnsEnablerDbService dbService = new SnsEnablerDbService();
			contextEvent.getServletContext().setAttribute(Constants.DB_SERVICE, dbService);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	@Override
	public void contextDestroyed(ServletContextEvent contextEvent) {
	}
}
